﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class ZoekPatient : System.Web.UI.UserControl
{
    public event EventHandler KiesPatient;
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    
    protected void Button1_Click(object sender, EventArgs e)
    {
        DropDownList1.Visible = true;
    }

    protected void SqlDone(object sender, EventArgs e)
    {
        if (((DropDownList)sender).Items.Count == 0)
        {
            DropDownList1.Visible = false;
            geenresultaat.Text = "Er zijn geen patienten gevonden";
        }
        else
        {
            geenresultaat.Text = "";
            if (this.KiesPatient != null)
                this.KiesPatient(sender, e);
        }
    }

    protected void anderePatient(object sender, EventArgs e)
    {
        if (this.KiesPatient != null)
            this.KiesPatient(sender, e);
    }

    public int patid
    {
        get
        {
            if (DropDownList1.Items.Count > 0)
                return int.Parse(DropDownList1.SelectedValue);
            else
                return 0;
        }
    }
}